public class try1 {
    public static int try1(int num[], int target) {
        int first = 0;
        int end = num.length - 1;
        while (first <= end) {
            int mid = (first + end) >>> 1;
            if (target > num[mid]) {
                first = mid + 1;
            } else if (target < num[mid]) {
                end = mid - 1;
            } else {
                return mid;
            }
        }
        return first;
    }
}
